package com.example.demo.com.crawler.service.impl;

import com.example.demo.com.crawler.dao.NewsDao;
import com.example.demo.com.crawler.pojo.News;
import com.example.demo.com.crawler.service.INewsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <h3>springboot-webmagic</h3>
 * <p></p>
 *
 * @author : 你的名字
 * @date : 2020-05-13 13:17
 **/
@Service
public class NewsServiceImpl implements INewsService {

    @Autowired
    private NewsDao newsDao;

    @Override
    public void save(News news) {
        //根据url和发布数据查询数据
        newsDao.insert(news);
    }

    @Override
    public List<News> find() {
        List<News> info = newsDao.selectList(null);
        return info;
    }
}
